package com.jsm.twentyfour.transfer;

import com.jsm.twentyfour.domain.RoomAccount;
import com.jsm.twentyfour.dto.RoomAccountDTO;
import com.kejin.util.autoCoding.CU;

/**
 * create by jsm on 2019/1/23
 */
public class RoomAccountTransfer {
    public static void main(String[] args) {
        CU.d(RoomAccount.class, RoomAccountDTO.class);
        CU.d(RoomAccountDTO.class, RoomAccount.class);
    }
    public static RoomAccountDTO transfer(RoomAccount roomAccount){
        if(roomAccount==null){
            return null;
        }
        RoomAccountDTO roomAccountDTO = new RoomAccountDTO();
        roomAccountDTO.setStatus(roomAccount.getStatus());
        roomAccountDTO.setUpdateAt(roomAccount.getUpdateAt());
        roomAccountDTO.setCreateAt(roomAccount.getCreateAt());
        roomAccountDTO.setUserId(roomAccount.getUserId());
        roomAccountDTO.setRoomId(roomAccount.getRoomId());
        roomAccountDTO.setId(roomAccount.getId());
        return roomAccountDTO;
    }





    public static RoomAccount transfer(RoomAccountDTO roomAccountDTO){
        if(roomAccountDTO==null){
            return null;
        }
        RoomAccount roomAccount = new RoomAccount();
        roomAccount.setStatus(roomAccountDTO.getStatus());
        roomAccount.setUpdateAt(roomAccountDTO.getUpdateAt());
        roomAccount.setCreateAt(roomAccountDTO.getCreateAt());
        roomAccount.setUserId(roomAccountDTO.getUserId());
        roomAccount.setRoomId(roomAccountDTO.getRoomId());
        roomAccount.setId(roomAccountDTO.getId());
        return roomAccount;
    }
}
